package com.huiyuan.mapper;

import com.huiyuan.common.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * @author huiyuan080
 * @data 2023/5/2
 * @apiNote
 */
@Mapper
public interface UserMapper {
    int deleteByPrimaryKey(Integer userId);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer userId);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int recharge(@Param("userId") Integer userId, @Param("price") BigDecimal price);

    /**
     * 修改用户是否用车
     *
     * @param userId
     */
    int addUse(@Param("userId") Integer userId);

    /**
     * 查询用户是否租从车
     * @param userId
     * @return
     */
    User isNull(@Param("userId") Integer userId);
}